<SCRIPT type="text/javascript">
	$(document).ready(function(){
		$(".nav_tabwps_4").rs_simpleTabs({
			tabElem				:".nav_tapIthems",			//切换标签的子元素
			tabCurrent			:"cur",						//切换标签的Current状态
			tabCont				:".nav_tabwps_4con",		//切换的元素内容父级
			tabContLayer		:".nav_tabwps_4_layouts",	//切换的元素内容层
			tabContLayerShow	:"show",					//切换的元素Current状态
			afclick				:null						//回调函数接口			
		});
	});
function submitForm(){
	if($("#flag").val()==1){
		$("#dbjdbcaddForm").submit();
	}
	else{
		$("#dbjndiaddForm").submit();
	}
}
//把数据库类型字段添加到表单里
function putDBType(type){
$("input[name='databasetype'][type='hidden']").val(type);
}
</SCRIPT>
<div class="artCon">
	<div class="bigArt">
		<div class="artMain">			
			<div class="leftList" style="height: 389px;">
				<h2>数据库类型：</h2>
				<ul>
					<li class="cur"><input type="radio" onclick="putDBType('oracle')" name="databasetype" style="float:left" id="oracle" value="oracle" checked="checked"/><i class="imgIco-101"></i><a href="javascript:void(0)">Oracle</a></li>
					<li><input type="radio" name="databasetype" style="float:left" onclick="putDBType('mysql')" id="mysql" value="mysql"/><i class="imgIco-100"></i><a href="javascript:void(0)" >MySQL</a></li>
					<li><input type="radio" name="databasetype" style="float:left" onclick="putDBType('sqlserver')" id="sqlserver" value="sqlserver"/><i class="imgIco-102"></i><a href="javascript:void(0)" >SQL Server</a></li>
					<li><input type="radio" name="databasetype" style="float:left" onclick="putDBType('rivues')" id="rivues" value="rivues"/><i class="imgIco-9"></i><a href="javascript:void(0)" >R3 Rivues</a></li>
					<li><input type="radio" name="databasetype" style="float:left" onclick="putDBType('hive')" id="hive" value="hive"/><i class="imgIco-9"></i><a href="javascript:void(0)" >Apache Hive</a></li>
					<li><input type="radio" name="databasetype" style="float:left" onclick="putDBType('other')" id="other" value="other"/><i class="imgIco-13"></i><a href="javascript:void(0)" >其他数据库</a></li>
				</ul>
			</div>
			<div class="rightCon">
				<div class="rightList" style="height: 389px;">
					<div class="listCon" style="margin-top:0px;">
						<ul class="nav_tapWrap nav_tabwps_4">
							<li onclick="document.getElementById('flag').value=1" class="nav_tapIthems cur"><i class="tabIcon tabicon-2"></i>JDBC</li>
							<li onclick="document.getElementById('flag').value=2" class="nav_tapIthems "><i class="tabIcon tabicon-6"></i>JNDI</li>
						</ul>
					</div>
						<div class="nav_tabwps_4con" id="tsk_aaddss">
							<div class="nav_tabwps_4_layouts show">
							<form class="form-horizontal" id="dbjdbcaddForm" data-toggle="form" action="/${orgi}/dm/database/databaseaddo.html" method="post">	
							<input type="hidden" name="databasetype" value="oracle"/>	
							<input type="hidden" name="connctiontype" value="jdbc"/>					
								<fieldset class="control-group">
									<label class="control-label" for="name">链接名称：</label>
									<div class="controls">
										<input class="required span3"  maxlength="255"
											 name="name" type="text"> <span
											class="help-inline"></span><i class="inputip">*</i>
									</div>
								</fieldset>
								<fieldset class="control-group">
									<label class="control-label" for="name">驱动名称（Driver）：</label>
									<div class="controls">
										<input class="required span3" maxlength="255"
											 name="driverclazz" type="text"> <span
											class="help-inline"></span><i class="inputip">*</i>
									</div>
								</fieldset>
								<fieldset class="control-group">
									<label class="control-label" for="name">数据库链接（URL）：</label>
									<div class="controls">
										<input class="required span3"  maxlength="255"
											 name="databaseurl" type="text"> <span
											class="help-inline"></span><i class="inputip">*</i>
									</div>
								</fieldset>
								<fieldset class="control-group">
									<label class="control-label" for="name">账号：</label>
									<div class="controls">
										<input class="span3" maxlength="255" 
											 name="account" type="text"> <span
											class="help-inline"></span>
									</div>
								</fieldset>
								<fieldset class="control-group">
									<label class="control-label" for="name">密码：</label>
									<div class="controls">
										<input class="span3" maxlength="255"
											 name="password" type="password"> <span
											class="help-inline"></span>
									</div>
								</fieldset>
								<fieldset class="control-group">
									<label class="control-label" for="name">访问标识：</label>
									<div class="controls">
										<input class="span3"  maxlength="255" 
											 name="code" type="text"> <span
											class="help-inline"></span>
									</div>
								</fieldset>
								<fieldset class="control-group">
									<label class="control-label" for="name">更多参数：</label>
									<div class="controls">
										<textarea class="span3" style="height:50px;"maxlength="255"
											 name="connectparam" type="text"></textarea> <span
											class="help-inline"></span>
									</div>
								</fieldset>
								</form>
							</div>
							
							<div class="nav_tabwps_4_layouts">
								<form class="form-horizontal" id="dbjndiaddForm" data-toggle="form" action="/${orgi}/dm/database/databaseaddo.html" method="post">
								<input type="hidden" name="connctiontype" value="jndi"/>
								<input type="hidden" name="databasetype" value="oracle"/>									
								<fieldset class="control-group">
									<label class="control-label" for="name">JNDI名称：</label>
									<div class="controls">
										<input class="required span3" maxlength="255" 
											name="jndiname" type="text" value=""> <span
											class="help-inline"></span><i class="inputip">*</i>
									</div>
								</fieldset>
								<fieldset class="control-group">
									<label class="control-label" for="name">更多参数：</label>
									<div class="controls">
										<textarea class="span3" style="height:50px;"maxlength="255"
											 name="jndiparam" type="text"></textarea> <span
											class="help-inline"></span>
									</div>
								</fieldset>
								</form>
							</div>
						</div>
				</div>
			</div>
			</div>
			<div class="bottomBg">
			<div class="btnWrap">
				<input type="button" onclick="submitForm()" class="subButtonStyle" value="确认"/>
				<input type="hidden" id="flag" value="1">
				<input type="button" onclick="closeR3ArtDialog()" class="cancelButtonStyle" value="取消"/>
			</div>
		</div>
</div>
</div>
<script type="text/javascript">
	$(function(){
		$(".leftList ul li").hover(function(){
			$(this).addClass("cur").siblings("li").removeClass("cur");
		},function(){
			$(this).removeClass("cur");	
		});
	})
</script>
